// import { getAllRoleList, isAccountExist } from '@/api/demo/system';
import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref, onMounted } from 'vue';
import { getItemApi } from '@/api/demo/code';
import { useI18n } from "@/hooks/web/useI18n";

const { t } = useI18n();
/**
 * transform mock data
 * {
 *  0: '华东分部',
 * '0-0': '华东分部-研发部'
 * '0-1': '华东分部-市场部',
 *  ...
 * }
 */
// export const deptMap = (() => {
//   const pDept = ['华东分部', '华南分部', '西北分部'];
//   const cDept = ['研发部', '市场部', '商务部', '财务部'];

//   return pDept.reduce((map, p, pIdx) => {
//     map[pIdx] = p;

//     cDept.forEach((c, cIndex) => (map[`${pIdx}-${cIndex}`] = `${p}-${c}`));

//     return map;
//   }, {});
// })();
//表头数据
export const columns: BasicColumn[] = [
  {
    title: t('sys.comment.columns.comment'),
    dataIndex: 'mac',
    width: 50,
  },

  {
    title: t('sys.comment.columns.commentNum'),
    dataIndex: 'commentNum',
    width: 50,
  },
  {
    title: t('sys.comment.columns.chatRule'),
    dataIndex: 'chatRule',
    width: 50,
  },
];

export const accountFormSchema: FormSchema[] = [
  {
    field: 'commentNum',
    component: 'Input',
    label: t('sys.comment.columns.commentNum'),
    defaultValue: '',
    colProps: {
      span: 12,
    },
  },
  {
    field: 'commentRule',
    component: 'Input',
    label: t('sys.comment.columns.chatRule'),
    defaultValue: '',
    colProps: {
      span: 12,
    },
  },
  {
    field: 'comment',
    slot: 'comment',
    label: t('sys.comment.columns.comment'),
    defaultValue: '',
    // rules: [{ required: true }],
     colProps: {
      span: 20,
    },
  },
  // {
  //   field: 'type',
  //   component: 'Select',
  //   label: t('sys.device.columns.devicecode'),
  //   defaultValue: '',
  //   rules: [{ required: true }],
  //   componentProps: {
  //     options: [],
  //   },
  // },
];
